﻿using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using DevComponents.DotNetBar.Controls;
using System.Collections;
namespace QuanLyThietBi.Manager
{
                

    public class TBL_LoaiThietBiManager:QuanLyThietBi.ManagerBase.TBL_LoaiThietBiManagerBase
    {
            public static TBL_LoaiThietBiManager CreateInstant()
            {
                return new TBL_LoaiThietBiManager();
            }
            public DataTable LayDanhSachLoaiThietBi()
            {
                string strsql = "select  ROW_NUMBER () Over (order by a.MaLoaiTB) as STT,* from tbl_loaithietbi a";
                return SqlHelper.ExecuteDataTable(Config.ConnectionConfig.ConnectionString, CommandType.Text, strsql);
            }
            //public void HienThiComboBoxLoaiThietBi(ComboBoxEx cb)
            //{
            //    cb.DataSource = TBL_LoaiThietBiManager.CreateInstant().SelectAll();
            //    cb.DisplayMember = "TenLoaiTB";
            //    cb.ValueMember = "MaLoaiTB";
                
            //}

            public void HienThiComboBoxLoaiThietBi(ComboBoxEx cb)

            {
                DataTable dataTable = TBL_LoaiThietBiManager.CreateInstant().SelectAll();
                DataRow row = dataTable.NewRow();
                row["MaLoaiTB"] = "None";
                row["TenLoaiTB"] = "---Chọn---";
                dataTable.Rows.InsertAt(row, 0);
                cb.DataSource = dataTable;
                cb.DisplayMember = "TenLoaiTB";
                cb.ValueMember = "MaLoaiTB";
             }

    }
}
                    
